]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/shadow: Add a fast path to comparisons
authorJonas Dreßler <verdre@v0yd.nl>
Fri, 5 Mar 2021 11:28:39 +0000 (12:28 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 14 Feb 2022 12:52:20 +0000 (12:52 +0000)
We do this in most places in St, it's consistent to do it here, too.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1744>

src/st/st-shadow.c

index ab3eaa856b0cd39aeb1883b9b402145f99544d87..0a8e319ad45b11cebb34dbd3e2950445fbf1fe8f 100644 (file)
@@ -126,6 +126,9 @@ st_shadow_equal (StShadow *shadow,
   g_return_val_if_fail (shadow != NULL, FALSE);
   g_return_val_if_fail (other != NULL, FALSE);
 
+  if (shadow == other)
+    return TRUE;
+
   /* We use strict equality to compare double quantities; this means
    * that, for example, a shadow offset of 0.25in does not necessarily
    * compare equal to a shadow offset of 18pt in this test. Assume